From: Keir Fraser Date: Tue, 8 Jan 2008 09:57:59 +0000 (+0000) Subject: x86, hvm: Add a perf counter for CR0.WP=0 emulation. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14445^2~71 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=c741a6246754635ac808b74ee5b0bd51bdfccaa8;p=xen.git x86, hvm: Add a perf counter for CR0.WP=0 emulation. Signed-off-by Kevin Tian --- diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c index 4777e54080..1c4e7fad70 100644 --- a/xen/arch/x86/mm/shadow/multi.c +++ b/xen/arch/x86/mm/shadow/multi.c @@ -2899,7 +2899,10 @@ static int sh_page_fault(struct vcpu *v, if ( is_hvm_domain(d) && unlikely(!hvm_wp_enabled(v)) && regs->error_code == (PFEC_write_access|PFEC_page_present) ) + { + perfc_incr(shadow_fault_emulate_wp); goto emulate; + } perfc_incr(shadow_fault_fixed); d->arch.paging.log_dirty.fault_count++; diff --git a/xen/include/asm-x86/perfc_defn.h b/xen/include/asm-x86/perfc_defn.h index eb18b5fe38..460c1f2b58 100644 --- a/xen/include/asm-x86/perfc_defn.h +++ b/xen/include/asm-x86/perfc_defn.h @@ -56,6 +56,7 @@ PERFCOUNTER(shadow_fault_emulate_read, "shadow_fault emulates a read") PERFCOUNTER(shadow_fault_emulate_write, "shadow_fault emulates a write") PERFCOUNTER(shadow_fault_emulate_failed, "shadow_fault emulator fails") PERFCOUNTER(shadow_fault_emulate_stack, "shadow_fault emulate stack write") +PERFCOUNTER(shadow_fault_emulate_wp, "shadow_fault emulate for CR0.WP=0") PERFCOUNTER(shadow_fault_mmio, "shadow_fault handled as mmio") PERFCOUNTER(shadow_fault_fixed, "shadow_fault fixed fault") PERFCOUNTER(shadow_ptwr_emulate, "shadow causes ptwr to emulate")